<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta content="telephone=no" name="format-detection">
<link rel="stylesheet" type="text/css" href="../static/easyui/themes/bootstrap/easyui.css">
<link rel="stylesheet" type="text/css" href="../static/easyui/themes/icon.css">
<link rel="stylesheet" href="../static/metisMenu/metisMenu_custom.css" />
<link rel="stylesheet" href="../static/css/style-app.css" />
<script src="../static/jquery/jquery-1.12.4.js"></script>
<script src="../static/easyui/jquery.easyui.min.js"></script>
<script src="../static/easyui/locale/easyui-lang-zh_CN.js"></script>
<script src="../static/jqueryValidate/jquery.validate.min.js"></script>
<script src="../static/jqueryValidate/additional-methods.min.js"></script>
<script src="../static/jqueryValidate/localization/messages_zh.min.js"></script>
<script src="../static/js/base-loading.js"></script>
<title>项目管理</title>
</head>
<body>
	<div class="top-part">
		<div class="header">
			<div class="return">
				<a href="javascript:history.go(-1);"></a>
			</div>
			<div class="header-title">子项目管理</div>
		</div>
	</div>
	<div class="new-form">
		<div>
			<form id="ff" method="post">
				<table cellpadding="5" style="margin: auto;">
					<tr>
						<td style="width: 100px;">子项目名：</td>
						<td>
							<input class="easyui-textbox" id="childname" name="childname" readonly="true"
								style="width: 100%;" />
						</td>
					</tr>
					<tr>
						<td style="width: 100px;">立项号：</td>
						<td>
							<input class="easyui-textbox" id="childprojectno" name="childprojectno" readonly="true"
								style="width: 100%;" />
						</td>
					</tr>
					<tr>
						<td style="width: 100px;">工程概况：</td>
						<td colspan="4">
							<input class="easyui-textbox" id="childcontent" name="childcontent"
								data-options="multiline:true" style="width: 100%; height: 80px;" readonly="true" />
						</td>
					</tr>
					<tr>
						<td style="width: 100px;">预算成本(元)：</td>
						<td>
							<input class="easyui-textbox" id="childcompactmoney" name="childcompactmoney"
								data-options="validType:'number'" style="width: 100%;" readonly="true" />
						</td>
					</tr>
					<tr>
						<td style="width: 100px;">百分比：</td>
						<td>
							<input class="easyui-textbox" id="childpercent" name="childpercent"
								data-options="validType:'number'" style="width: 100%;" readonly="true" />
						</td>
					</tr>
					<tr>
						<td style="width: 100px;">开始日期：</td>
						<td>
							<input class="easyui-datebox" id="childstartdate" name="childstartdate"
								data-options="editable:false" style="width: 100%;" readonly="true" />
						</td>
					</tr>
					<tr>
						<td style="width: 100px;">结束日期：</td>
						<td>
							<input class="easyui-datebox" id="childenddate" name="childenddate"
								data-options="editable:false" style="width: 100%;" readonly="true" />
						</td>
					</tr>
					<tr>
						<td style="width: 100px;">班组长：</td>
						<td>
							<input style="width: 100%;" id="levelchild2" name="levelchild2" class="easyui-combobox" readonly="true"
								data-options="
							    valueField: 'id',
							    textField: 'name',
							    multiple:true,
							    onSelect: function(rec){
							    
							    },panelHeight: 'auto',
							     editable:false">
						</td>
					</tr>
					<tr>
						<td style="width: 100px;">班组成员：</td>
						<td colspan="3">
							<input style="width: 100%; height: 80px;" id="levelchild3" name="levelchild3" class="easyui-combotree" readonly="true"
								data-options="
							    valueField: 'id',
							    textField: 'name',
							    multiline:true,
							    multiple:true,
							   	url:'../usertree.do',
							    onSelect: function(rec){
							    
							    },panelHeight: '250',
							    editable:false">
						</td>
					</tr>
				</table>
			</form>
		</div>
	</div>
</body>
<script th:inline="javascript">
	var currentPro =[[${projectItemChild}]];
	
	$(document).ready(function() {
		var url = '../duty3.do?projectitemid=' + currentPro.projectitemid;
		$('#levelchild2').combobox('reload', url);
		if(currentPro.id != null){
			$("#childname").textbox("setValue", currentPro.name);
			$("#childprojectno").textbox("setValue", currentPro.projectno);
			$("#childcontent").textbox("setValue", currentPro.content);
			$("#childcompactmoney").textbox("setValue", currentPro.compactmoney);
			$("#childpercent").textbox("setValue", currentPro.percent);
			$("#childstartdate").datebox("setValue", formatDate(currentPro.startdate));
			$("#childenddate").datebox("setValue", formatDate(currentPro.enddate));
			var arr2 = new Array(currentPro.level2.length);
			for(var i = 0;i < arr2.length;i++){
				arr2[i] = currentPro.level2[i]
			}
			$("#levelchild2").combobox("setValue", arr2);
			var arr3 = new Array(currentPro.level3.length);
			for(var i = 0;i < arr3.length;i++){
				arr3[i] = currentPro.level3[i]
			}
			$("#levelchild3").combotree("setValue", arr3);
		}
	});
	function formatDate(time) {
		var date = new Date(time);
		var year = date.getFullYear(),month = date.getMonth() + 1, //月份是从0开始的
		day = date.getDate(),hour = date.getHours(),min = date.getMinutes(),sec = date.getSeconds();
		var newTime = year + '-' + month + '-' + day;
		return newTime;
	}
</script>

</html>